<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<link  rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}"/>
<head lang="en">
    <title>Messages : View all</title>
</head>
<body>
<div class="container">
    <div th:replace="fragments :: navbar"></div>
    <div class="float-right mt-2">
        <a class="btn btn-primary btn-sm" href="form.html" th:href="@{/(form)}">Create Message</a>
    </div>
    <h4 class="float-left mt-2">Messages : View all</h4>
    <table class="table table-bordered table-striped">
        <thead>
        <tr>
            <th>ID</th>
            <th>Created</th>
            <th>Summary</th>
            <th>Sex</th>
            <th>Eat chicken</th>
        </tr>
        </thead>
        <tbody>
        <tr th:if="${messages.empty}">
            <td colspan="5">No messages</td>
        </tr>
        <tr th:each="message : ${messages}">
            <td th:text="${message.id}">1</td>
            <td th:text="${#calendars.format(message.created)}">July 11,
                2012 2:17:16 PM CDT</td>
            <td><a href="view.html" th:href="@{'/' + ${message.id}}"
                   th:text="${message.summary}"> The summary </a></td>
            <td th:text="${message.gender}">Sex</td>
            <td th:text="${message.enableFlag==true}? '是':'否'">Eat chicken</td>
           <!-- <td th:if="${message.enableFlag==true}" th:text="是">Eat chicken</td>-->
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>